package code.jvm.c7heap;

import java.util.ArrayList;
import java.util.Random;
import java.util.TreeMap;

public class OOMTest {
    public static void main(String[] args) {
        ArrayList<Picture> list = new ArrayList<Picture>();
        while (true){
            /*
            try {
                Thread.sleep(20);
            } catch (InterruptedException e) {
                throw new RuntimeException(e);
            }*/
            list.add(new Picture(new Random().nextInt(1024 * 1024)));
        }
    }
    static class Picture{
        private byte[] pixels;
        public Picture(int length){this.pixels = new byte[length];}
    }
}
